<template>
	<view>
		<view class="example">

			<view class="uni-list">
				<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,index) in news" :key="index" @tap="openinfo"
				 :data-newsid="item.post_id">
					<view class="uni-media-list">
						<!-- <image class="uni-media-list-logo" :src="item.author_avatar"></image> -->
						<view class="uni-media-list-body">
							<view class="uni-media-list-text-top">{{item.typeNamezong}}</view>
							<view class="uni-list">
								<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item2,index2) in item.newsLists" :key="index2">
									<view class="uni-media-list">

										<view class="uni-media-list-body">

											<view class="uni-media-list-text-bottom uni-ellipsis">{{item2.title}}</view>
										</view>
									</view>
								</view>
							</view>
							<!-- <view class="uni-media-list-text-bottom uni-ellipsis">{{item.typeNamezong}}</view> -->
						</view>
					</view>
				</view>
			</view>

		</view>

<!-- 
		<view>
			<uni-fab :pattern="pattern" :content="content" :horizontal="horizontal" :vertical="vertical" :direction="direction"
			 @trigger="trigger"></uni-fab>

		</view> -->
	</view>
</template>

<script>
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import {
		request
	} from '../../api/api.js'

	import uniIcon from '@dcloudio/uni-ui';
	import uniFab from '@/components/uni-fab/uni-fab.vue';
	export default {
		components: {
			uniPopup,
			uniFab
		},
		data() {
			return {
				news: [],
				type: '',
				list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
				array: ['小程序',

					'图片',

					'复制文字'
				],
				index: 0,
				bottomData: [{
						text: '微信',
						icon: '\ue6a4',
						name: 'wx'
					},
					{
						text: '朋友圈',
						icon: '\ue646',
						name: 'wx'
					},
					{
						text: '复制',
						icon: '\ue632',
						name: 'copy'
					}
				],
				horizontal: 'right',
				vertical: 'bottom',
				direction: 'horizontal',
				pattern: {
					// color: '#7A7E83',
					backgroundColor: '#fff',
					// selectedColor: '#007AFF',
					buttonColor: "#007AFF"
				},
				content: [{
						iconPath: '/static/images/weixin.png',
						selectedIconPath: '/static/images/weixin.png',
						text: '微信',
						active: false
					},
					{
						iconPath: '/static/images/weixin.png',
						selectedIconPath: '/static/images/weixin.png',
						text: '文字',
						active: false
					},
					{
						iconPath: '/static/images/weixin.png',
						selectedIconPath: '/static/images/weixin.png',
						text: '海报',
						active: false
					}
				]
			};
		},
		onBackPress() {
			if (this.type !== '') {
				this.type = '';
				return true;
			}
		},
		onLoad: function() {
// 			uni.showLoading({
// 				title: "加载中...."
// 			})
// 			request('wx/news/getNews', null, {
// 				method: 'get'
// 			}).then((res) => {
// 				console.log("aaa:  " + JSON.stringify(res.data.data))
// 				this.news = res.data.data
// 				if (!this.list.length) {
// 					this.isNodata = false
// 				}
// 				uni.hideLoading();
// 
// 			})
		},

// 		methods: {
// 			togglePopup(type) {
// 				this.type = type;
// 			},
// 
// 			trigger(e) {
// 				console.log(e);
// 				// this.content[e.index].active = !e.item.active;
// 
// 
// 				if (e.index == 0) {
// 					console.log("选中了微信分享")
// 					// #ifdef MP-WEIXIN
// 					console.log('微信')
// 
// 
// 					// #endif
// 
// 				}
// 
// 				if (e.index == 1) {
// 					console.log("选中了文字分享")
// 					// #ifdef MP-WEIXIN
// 					console.log('微信')
// 					uni.setClipboardData({
// 						data: '微信复制',
// 						success: function() {
// 							console.log('success');
// 						}
// 					});
// 
// 					// #endif
// 
//              // #ifdef MP-TOUTIAO
// 					console.log('微信')
// 					uni.setClipboardData({
// 						data: '今日头条复制',
// 						success: function() {
// 							console.log('success');
// 							uni.showToast({
// 								title:"成功",
// 								icon:"success"
// 							})
// 						}
// 					});
// 
// 					// #endif
// 
// 				}
// 				// 				
// 
// 				// 				uni.showModal({
// 				// 					title: '提示',
// 				// 					content: `您${this.content[e.index].active?'选中了':'取消了'}${e.item.text}`,
// 				// 					success: function(res) {
// 				// 						if (res.confirm) {
// 				// 							console.log('用户点击确定');
// 				// 						} else if (res.cancel) {
// 				// 							console.log('用户点击取消');
// 				// 						}
// 				// 					}
// 				// 				});
// 			}
// 		}
	};
</script>
<style>
	page {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		background-color: #fff
	}

	.share {
		position: fixed;
		right: 10%;
		bottom: 10%;
	}

	.shareChroose {
		/* position: fixed; */
	}

	view {
		font-size: 28upx;
		line-height: inherit
	}

	.example {
		padding: 0 30upx 30upx
	}

	.example-title {
		font-size: 32upx;
		line-height: 32upx;
		color: #777;
		margin: 40upx 25upx;
		position: relative
	}

	.example .example-title {
		margin: 40upx 0
	}

	.example-body {
		padding: 0 40upx
	}

	.uni-padding-wrap {
		padding: 0 30upx;
	}

	.uni-media-list-body {
		height: auto;
	}

	.uni-media-list-text-top {
		line-height: 1.6em;
	}


	button {
		margin: 20upx 0;
	}

	.uni-helllo-text {
		height: 100upx;
		line-height: 100upx;
		text-align: center;
	}

	.center-box {
		width: 500upx;
		height: 500upx;
	}

	.uni-list-item {
		text-align: left;
		line-height: 80upx;
		border-bottom: 1px #f5f5f5 solid;
	}

	.uni-list-item:last-child {
		border: none;
	}

	.center-box .image {
		width: 100%;
		height: 100%;
	}

	.bottom-title {
		line-height: 60upx;
		font-size: 24upx;
		padding: 15upx 0;
	}

	.bottom-content {
		display: flex;
		flex-wrap: wrap;
		padding: 0 35upx;
	}

	.bottom-content-box {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-bottom: 15upx;
		width: 25%;
		box-sizing: border-box;
	}

	.bottom-content-image {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 90upx;
		height: 90upx;
		overflow: hidden;
		background: #007aff;
		border-radius: 10upx;
	}

	.bottom-content-text {
		font-size: 26upx;
		color: #333;
		margin-top: 10upx;
	}

	.bottom-btn {
		height: 90upx;
		line-height: 90upx;
		border-top: 1px #f5f5f5 solid;
	}

	.bottom-content-image.wx {
		background: #00ce47;
	}

	.bottom-content-image.qq {
		background: #00b6f6;
	}

	.bottom-content-image.sina {
		background: #ff766a;
	}

	.bottom-content-image.copy {
		background: #07ccd0;
	}

	@font-face {
		font-family: 'iconfont';
		/* project id 1028200 */
		src: url('https://at.alicdn.com/t/font_1028200_47ewtwy4t04.ttf') format('truetype');
	}

	.icon {
		font-family: 'iconfont';
		font-size: 40upx;
		color: #fff;
	}
</style>
